<?php
namespace app\index\controller;
use app\index\controller\Base;
use think\Db;

class Cate extends Base{
	public function index(){
		$cateid=input('cateid');
		//查询当前文章的栏目
		if (isset($cateid)) {
			$cate=db('article')->where('cateid','eq',$cateid)->paginate(3);
		}else{
			$cate=db('article')->paginate(3);
		}
		$catename=db('cate')->find($cateid);
		$this->assign('catename',$catename);
		$this->assign('cate',$cate);
		return $this->fetch('cate');
	}
}

?>